package com.qububu.play.dineTogether.dto;

import java.util.ArrayList;
import java.util.List;

import com.qububu.utils.DateUtil;
import com.qububu.utils.SystemUtil;

public class DineSummarizeDto {

	private String summarizeId;
	private String content;
	private String pictures;
	private int createDt;
	private String authorId;
	private String actionId;
	
	public DineSummarizeDto(String summarizeId, String actionId, String authorId) {
		this.summarizeId = summarizeId;
		this.actionId = actionId;
		this.authorId = authorId;
	}
	
	public DineSummarizeDto(long summarizeId, long actionId, long authorId) {
		this.summarizeId = SystemUtil.encrypt(String.valueOf(summarizeId));
		this.actionId = SystemUtil.encrypt(String.valueOf(actionId));
		this.authorId = SystemUtil.encrypt(String.valueOf(authorId));
	}
	
	public String getActionId() {
		return actionId;
	}
	public String getSummarizeId() {
		return summarizeId;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getPictures() {
		return pictures;
	}
	public void setPictures(String pictures) {
		this.pictures = pictures;
	}
	public int getCreateDt() {
		return createDt;
	}
	public void setCreateDt(int createDttm) {
		this.createDt = createDttm;
	}
	public String getAuthorId() {
		return authorId;
	}
	
	/**
	 * 按字符串显示时间(年-月-日)
	 * */
	public String showCreateDtInString() {
		
		return DateUtil.formatDTString(createDt);
	}
	
	/**
	 * 得到图片列表
	 * */
	public List<String> getPicturesList() {
		List<String> picList = new ArrayList<String>();
		
		String[] pics = pictures.split(";");
		for (String picUrl : pics) {
			picList.add(picUrl);
		}
		
		return picList;
	}
}
